<%@ page import="databean.Email"%>
<%@ page import="java.util.ArrayList" %>

<a href="user-logout.do">Log Out</a><br>

<div id="header">
<h1>Emails</h1>
</div>

<div id="user-view-emails">

<%
	ArrayList<Email> emails = (ArrayList<Email>) request.getAttribute("emails");
	
	for (int i=0; i<emails.size(); i++) {
		
		Email email = emails.get(i);
		
		String s = email.getSender().replace("<","&lt;").toString();
		s = s.replace(">","&gt;").toString();
		
		String r = email.getRecipient().replace("<","&lt;").toString();
		r = r.replace(">","&gt;").toString();
								
%>

			Email ID: <%= email.getEmailID() %><br>
			User ID: <%= email.getUserID() %><br>
			Outlook ID: <%= email.getOutlookID() %><br>
			Timestamp: <%= email.getTimestamp() %><br>
			Sender: <%= s %><br>
			Recipient: <%= r %><br>
			Subject: <%= email.getSubject() %><br>
			Body: <%= email.getBody() %><br><br>

<%
	}
%>

</div>